﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Practices.Unity;
using Astor.Modules.DataSources.Services;
using Astor.Modules.DataSources.Screens.Details;
using Astor.Modules.DataSources.Screens.List;
using Astor.Modules.DataSources.Models;

namespace Astor.Modules.DataSources
{
    public class DesignDatalLocator
    {
        public DataSourceDetailsViewModel DataSourceDetailsViewModel
        {
            get
            {
                var vm = Container.Resolve<DataSourceDetailsViewModel>();
                vm.InitializeEdit("Edit data source",
                   new DataSource { Name = "Neflix", Url = @"http://services.odata.org/Northwind/Northwind.svc/" });
                return vm;
            }
        }

        public DataSourceListViewModel DataSourceListViewModel
        {
            get 
            { 
                var vm = Container.Resolve<DataSourceListViewModel>();
                return vm;
            }
        }
        
        public DesignDatalLocator()
        {
            Container = new UnityContainer();
            Container.RegisterInstance<IDataSourcesService>(new SampleDataSourcesService());
        }

        private IUnityContainer Container { get; set; }
    }
}
